<include file="Public/inc/header.html" />
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">系统用户列表</h3>
                    </div><!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>
                                        药品名称
                                    </th>
                                    <th>
                                        生产厂家
                                    </th>
                                    <th>
                                        剩余数量
                                    </th>
                                    <th>
                                        冲突药品
                                    </th>
                                    <th>
                                        过期时间
                                    </th>
                                    <th>
                                        所在仓库
                                    </th>
                                    <th>
                                        操作
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <foreach name="data" item='data'>
                                    <tr class="pure-table-odd"> 
                                        <td>{$data['name']}</td> 
                                        <td>{$data['company']}</td> 
                                        <td>{$data['rest_num']}</td> 
                                        <td>{$data['crash_id']|default='暂无冲突药品'}</td> 
                                        <td>{$data['period']|date='Y-m-d',###}</td> 
                                        <td>{$data['depot_id']}</td> 
                                        <td>
                                            <button type='button' data-id="{$data['id']}" class='btn btn-danger delete' data-toggle="modal" data-target="#myModal">删除</button>　
                                            <a href="/drm/index.php/Home/Drugs/Index/drugEdit.html?id={$data['id']}"><button type='button' class='btn btn-warning'>编辑</button></a>
                                        </td>
                                    </tr>
                                </foreach>
                            </tbody>
                        </table>
                    </div><!-- /.box-body -->
                </div><!-- /.box -->
            </div>
        </div>
    </div>
</section>
<include file="Public/inc/footer.html" />
    <script>
        $('.delete').click(function(){
            var id = $(this).data('id');

            $('#yes').click(function(){
                $.post('/drm/index.php/Home/Drugs/Index/drugDelete.html',{'id':id},function(){
                    window.location.reload();
                })
            })
        })
    </script>
